Unit. 5 -- Common Modeling Situations
The Four-Step Design Method for Design a Fact Table
1. Step 1: Choosing the data mart
2. Step 2: Deside the fact table grain
- The lower the level of granularity, the more robust the design
- Easily handle unexpected queries and additional new data elements
- Individual transaction level
. Each sales transaction
. Each insurance claim
. Each ATM transaction
- Individual snapshot level
. Each daily product sales total in each store
. Each monthly account snapshot
- Line_item level
. Each line-item on each order(shipment's invoice)
. Each coverage in each individual insurance level
3. Step 3: Choosing the dimensions
Example: Fact: Month level
Time dimension: can be year, but not daily level
4. Step 4: Choose the facts
Reason 1: Supply Chains, Value Chains, Value Circles
Multiple fact tables are needed to support a business with many processes. Each process spawns one or more fact tables.
A product moves from the acquisition of raw materials through to the finished good.
After a product enters finished goods inventory in a warehouse, it is thought of as being part of the demand chain, or value chain.
In other kind of business, all the entities may be performing or measuring the same kind of transaction,
Reason 2: Heterogeneous Product Schemas
Multiple fact tables are needed when a business has heterogeneous products that have naturally different facts but a single customer base.

Reason 3: Transactions and Snapshot Schemas
- Transactions fact table is usually built first

- Snapshot fact tables capture the periodic snapshots.
Reason 4: Aggregates
- Example: When a salesperson didn't get an order
- Example: Record student attendance of classes
- Add a dummy fact-like field: Attendance

- Use it when a primary fact table is sparse
- Regular sales fact table cannot answer: Which products on promotion did not sell?
- The coverage fact table will contain a row for each item on promotion
- Query processing of the above query:
. Find list of products in promotion from the coverage fact table
. MINUS
. Find the list of products that did sell
. Perform MINUS
- The coverage tables avoids storing explicit zeroes